import request from '@/config/axios'

export interface PurchaseLogVO {
  id: number
  orderSn: string
  companyId: number
  projectId: number
  purchaseId: number
  goodsId: number
  needNumber: number
  number: number
  endNumber: number
  arrivalPics: string
  signPics: string
}

// 查询采购记录列表
export const getPurchaseLogPage = async (params) => {
  return await request.get({ url: `/system/purchase-log/page`, params })
}

// 查询采购记录详情
export const getPurchaseLog = async (id: number) => {
  return await request.get({ url: `/system/purchase-log/get?id=` + id })
}

// 新增采购记录
export const createPurchaseLog = async (data: PurchaseLogVO) => {
  return await request.post({ url: `/system/purchase-log/create`, data })
}

// 修改采购记录
export const updatePurchaseLog = async (data: PurchaseLogVO) => {
  return await request.put({ url: `/system/purchase-log/update`, data })
}

// 删除采购记录
export const deletePurchaseLog = async (id: number) => {
  return await request.delete({ url: `/system/purchase-log/delete?id=` + id })
}

// 导出采购记录 Excel
export const exportPurchaseLog = async (params) => {
  return await request.download({ url: `/system/purchase-log/export-excel`, params })
}
